package com.h;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.widget.LinearLayout;
import android.widget.Toast;

/**
 * 
 * @author he.antai
 *
 */

public class ListviewPager extends Activity {
	
	protected static final int SUCCESS = 0;
	private Handler tipHandler=new Handler(){
		@Override
		public void handleMessage(Message msg) {
			super.handleMessage(msg);
			
			int result=msg.what;//TODO handler之间使用自定义消息类
			
			System.out.println("xxxxx");
			if(result==SUCCESS){
				Toast.makeText(ListviewPager.this, "success", Toast.LENGTH_SHORT).show();
			}else{
				Toast.makeText(ListviewPager.this, "fail", Toast.LENGTH_SHORT).show();
			}
			
		}
	};
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        
        
        LinearLayout listviewContainer=(LinearLayout) findViewById(R.id.listview_container);
        MyListView myListView=new MyListView(this,tipHandler);
        listviewContainer.addView(myListView);
    }
}